package com.example.googleguavaapachecommons.apachecommons.methods;


import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.ImmutableTriple;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.commons.lang3.tuple.Triple;

/**
 * @author zwzheng
 * @Classname Morereturnparams
 * @Description TODO
 * @Date 2021/1/4 14:44
 * @Version V1.0
 */
public class Morereturnparams {

      //返回2个参数
     public static Pair<String, String> getTwoReturnParams(){

          return  new ImmutablePair<>("1","2");
     }

      //返回3个参数
     public static Triple<String, String, String> getThreeTriple(){
          return new ImmutableTriple<>("1", "2", "3");
     }

     public static void main(String[] args) {

       //得到2个返回值
       Pair<String, String> twoReturnParams = Morereturnparams.getTwoReturnParams();
          System.out.println("第一个值：" + twoReturnParams.getLeft());
          System.out.println("第二个值：" + twoReturnParams.getRight());
       //得到3个返回值
       Triple<String, String, String> threeTriple = Morereturnparams.getThreeTriple();
          System.out.println("第一个值：" + threeTriple.getLeft());
          System.out.println("第二个值：" + threeTriple.getMiddle());
          System.out.println("第三个值：" + threeTriple.getRight());
     }

}